<template>
  <div class="container-slot-home">
    <div class="group-title">
      <div class="item-title">{{ title }}</div>
      <div class="item-more" @click="routerLink()">| 更多</div>
    </div>
    <div class="item-slot clearfix">
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '默认标题'
    },
    to: {
      type: String,
      default: '/'
    }
  },
  methods: {
    routerLink() {
      console.log(this.to)
      this.$router.push({ name: this.to })
    }
  }
}
</script>

<style lang="less" scoped>
.container-slot-home {
  position: relative;
  .group-title {
    padding-top: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
  }
  .item-title {
    position: relative;
    margin-left: 20px;
    padding: 0 20px 0 10px;
    box-sizing: border-box;
    display: inline-block;
    font-size: 12px;
    color: #fff;
    &::before {
      content: "";
      display: block;
      width: 100%;
      height: 16px;
      position: absolute;
      z-index: -1;
      left: 0;
      transform: perspective(150px) skewX(30deg) rotateY(30deg);
      background-color: #f45050;
    }
  }
  .item-slot {
    padding-bottom: 30px;
  }
}
</style>
